package com.juyu.miliao.api.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import com.juyu.miliao.api.service.VestRobotMessageService;
import com.juyu.miliao.common.domain.CommonHead;
import com.juyu.miliao.common.domain.Subject;
import com.juyu.miliao.common.util.VerifyUtil;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 马甲包机器人消息
 * @author wbf
 */
@RestController
@RequestMapping("/vestRobotMessage")
public class VestRobotMessageController {
    @Resource
    VestRobotMessageService vestRobotMessageService;

    /**
     * 马甲包机器人消息唤醒接口
     */
    @GetMapping()
    public void startVestRobotMessage(Authentication token, HttpServletRequest request){
        Subject subject = (Subject) token.getPrincipal();
        //应用Id,用来区分马甲包与线上包
        CommonHead com = VerifyUtil.verifyCommonHead(request);
        vestRobotMessageService.startVestRobotMessage(subject.getId(),com);
    }



}